{namespace form=TYPO3\CMS\Form\ViewHelpers}

<f:if condition="{model.showElement}">
	<f:format.raw>{model.layout.elementOuterWrap.0}</f:format.raw>
		<form:select
			class="{model.additionalArguments.class}"
			dir="{model.additionalArguments.dir}"
			id="{model.additionalArguments.id}"
			lang="{model.additionalArguments.lang}"
			style="{model.additionalArguments.style}"
			title="{model.additionalArguments.title}"
			accesskey="{model.additionalArguments.accesskey}"
			tabindex="{model.additionalArguments.tabindex}"
			onclick="{model.additionalArguments.onclick}"

			name="{model.additionalArguments.prefix}[{model.additionalArguments.name}]"
			value="{form:aggregateSelectOptions(model:model, returnSelectedValues: 1)}"

			multiple="{model.additionalArguments.multiple}"
			size="{model.additionalArguments.size}"

			optionLabelField="label"
			optionValueField="value"
			options="{form:aggregateSelectOptions(model:model)}"
			prependOptionLabel="{model.additionalArguments.prependOptionLabel}"
			prependOptionValue="{model.additionalArguments.prependOptionValue}"
			selectAllByDefault="{model.additionalArguments.selectAllByDefault}"
			sortByOptionLabel="{model.additionalArguments.sortByOptionLabel}"

			errorClass="{model.additionalArguments.errorClass}"
			additionalAttributes="{model.htmlAttributes}"
		/>
	<f:format.raw>{model.layout.elementOuterWrap.1}</f:format.raw>
</f:if>
